// 版权归 瞄你个汪 所有。使用本代码应遵守相关法律法规和许可证的要求。
import {Result, ResultPage} from "/@/types/global";
import request from '/@/utils/request';
import {AxiosResponse} from "axios";

/**
 * ⚙ 系统缓存管理接口
 * @author 瞄你个汪
 * @since 2024-01-01 12:00:00
 * @method remove 删除指定缓存
 * @method get 获取所有缓存键
 * @method clear 清空所有缓存
 * @method getKeys 获取所有缓存键
 */
export function useSysCacheApi() {
    return {
        remove: (params?: object):Promise<AxiosResponse< Result>> => {
            return request({
                url: '/api/sysCache/remove',
                method: 'post',
                params,
            });
        },
        get: (params?: object):Promise<AxiosResponse< Result>> => {
            return request({
                url: '/api/sysCache/get',
                method: 'post',
                params,
            });
        },
        clear: ():Promise<AxiosResponse< Result>> => {
            return request({
                url: '/api/sysCache/clear',
                method: 'post',
            });
        },
        getKeys: ():Promise<AxiosResponse< Result>> => {
            return request({
                url: '/api/sysCache/getKeys',
                method: 'post',
            });
        },
    };
}